subroutine abort(message)
  use logs
  implicit none
  character(*), intent(in) :: message
  integer ierr

  write(logunit,*)
  write(logunit,*)" ABORT "//message
  write(logunit,*)
  call flush(logunit)

  call endrun()
 
  stop
end subroutine abort

! --------------------------------------------------------------------

subroutine endrun()
  use logs

  write(logunit,*)' -Ending code'
  call flush(logunit)
  
end subroutine endrun

